package com.bawei.park2211a.fg

import androidx.recyclerview.widget.GridLayoutManager

import com.alibaba.android.arouter.launcher.ARouter
import com.bawei.base.bean.HomeEntity
import com.bawei.base.mvvm.BaseViewFragment

import com.bawei.park2211a.R
import com.bawei.park2211a.adapter.ServiceAdaprer
import com.bawei.park2211a.databinding.FragmentServiceBinding


class ServiceFragment : BaseViewFragment<FragmentServiceBinding>() {
    lateinit var serviceAdaprer: ServiceAdaprer
    override fun initView() {
        serviceAdaprer= ServiceAdaprer()
        serviceAdaprer.data.add(HomeEntity(R.drawable.cart,"车辆管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.stall," 车位管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.visitor,"访客管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.maintion,"维修管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.notice,"公告管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.alarmclock,"考勤管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.devicemanagement,"即时通讯"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.cart,"设备管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.house,"房源管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.real,"物业管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.zoom,"巡检管理"))
        serviceAdaprer.data.add(HomeEntity(R.drawable.vip,"月卡管理"))
        binding.serviceRec.adapter=serviceAdaprer
        binding.serviceRec.layoutManager=GridLayoutManager(requireContext(),3)
        serviceAdaprer.setOnItemClickListener { _, _, position ->
          when(position){
              0->{
                  ARouter.getInstance().build("/app/rov/ROVActivity").navigation()
              }
              1->{
                ARouter.getInstance().build("/app/park/ParkActivity").navigation()
              }
              2->{
                  ARouter.getInstance().build("/app/visit/VisitActivity").navigation()
              }
              3->{
                  ARouter.getInstance().build("/app/repair/RepairActivity").navigation()
              }
              4->{
                  ARouter.getInstance().build("/app/news/NewsActivity").navigation()
              }
              5->{
                  ARouter.getInstance().build("/app/person/PersonActivity").navigation()
              }

              6->{
                  ARouter.getInstance().build("/app/VrActivity").navigation()
              }
              7->{
                  ARouter.getInstance().build("/app/equipment/EquipmentActivity").navigation()
              }
              8->{
                  ARouter.getInstance().build("/house/HouseActivity").navigation()
              }
              9->{
                  ARouter.getInstance().build("/firm/FirmActivity").navigation()
              }
              10->{
                  ARouter.getInstance().build("/app/polling/PollingActivity").navigation()
              }
              11->{
                  ARouter.getInstance().build("/cashier/CashierActivity").navigation()
              }
          }
        }
    }

    override fun initData() {

    }
}